﻿@using Circle.Domain.Model
@{
    Layout = null; 

    TokenUser tokenUser = SecurityManager.CurrentUser;
    var isLoginUser = tokenUser != null;
   
    <div id="divLoginOnPanel-j">
    @if (isLoginUser)
            {
    <div class="dropdown">
      <a class="dropdown-toggle" id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="/page.html">
         @LocaleResources["Layout.MyAccount"]
        <b class="caret"></b>
      </a>
      <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
        <li>@Html.ActionLink(LocaleResources["Layout.MyTopics"], "topic", "user")</li>
        <li>@Html.ActionLink(LocaleResources["Layout.MyComments"], "comment", "user")</li>
        <li>@Html.ActionLink(LocaleResources["Layout.MySettings"], "setting", "user")</li>
      </ul>
    </div>
    <li id="layoutSignOutMenu-j"><a>@LocaleResources["Membership.SignOut"]</a></li>
            }
            else
            {
    <li id="layoutSignInMenu-j"><a class="btn btn-primary">
        <i class="icon-user icon-white"></i>@LocaleResources["Membership.SignIn"]</a></li>
    <li id="layoutRegisterMenu-j"><a>@LocaleResources["Membership.Register"]</a>
    </li>
            }
    </div>
 
    if (!isLoginUser)
    {
    <div>@Html.Partial("_UserAuthentication")</div>
    }

    var user = isLoginUser ?  new TokenUserClientModel(tokenUser) : new TokenUserClientModel();
    if(!IsAjax)
    {
        @ScriptRegister.RegisterJsonOnClientNow("currentUser", user);
    }
}
